Warnings

   [1] "None of the 2000 iterations ended with a divergent transition."

Numerical diagnostics

                   n_eff Rhat   mean se_mean   sd
   log-posterior  885.84    1 -65.99    0.05 1.42
   log_lik[93]   1592.79    1  -0.75    0.01 0.22
   log_lik[75]   1594.39    1  -1.15    0.01 0.40
   beta[1]       1638.06    1  -0.67    0.01 0.25

Visual diagnostics

Divergence Information

These are plots of the divergent transition status (x-axis) against the log-posterior (y-axis top panel) and against the acceptance statistic (y-axis bottom panel) of the sampling algorithm for all chains. Divergent transitions can indicate problems for the validity of the results. A good plot would show no divergent transitions. If the divergent transitions show the same pattern as the non divergent transitions, this could indicate that the divergent transitions are false positives. A bad plot would shows systematic differences between the divergent transitions and non-divergent transitions. For more information see https://mc-stan.org/misc/warnings.html#divergent-transitions-after-warmup.

Energy

These are plots of the overlaid histograms of the marginal energy distribution (\(\pi_E\)) and the energy transition distribution (\(\pi_{\Delta E}\)) for all chains. A good plot shows histograms that look well-matched indicating that the Hamiltonian Monte Carlo should perform robustly. The closer \(\pi_{\Delta E}\) is to \(\pi_E\) the faster the random walk explores the energies and the smaller the autocorrelations will be in the chain. If \(\pi_{\Delta E}\) is narrower than \(\pi_E\) the random walk is less effective and autocorrelations will be larger. Additionally the chain may not be able to completely explore the tails of the target distribution. See Betancourt ‘A conceptual introduction to Hamiltonian Monte Carlo’ and Betancourt ‘Diagnosing suboptimal cotangent disintegrations in Hamiltonian Monte Carlo’ for the general theory behind the energy plots.

Treedepth Information

These are plots of the treedepth (x-axis) against the log-posterior (y-axis top left panel) and against the acceptance statistic (y-axis top right panel) of the sampling algorithm for all chains. In these plots information is given concerning the efficiency of the sampling algorithm. Zero treedepth can indicate extreme curvature and poorly-chosen step size. Treedepth equal to the maximum treedepth might be a sign of poor adaptation or of a difficult posterior from which to sample. The former can be resolved by increasing the warmup time, the latter might be mitigated by reparametrization. For more information see https://mc-stan.org/misc/warnings.html#maximum-treedepth-exceeded or https://mc-stan.org/docs/reference-manual/hmc-algorithm-parameters.html.

Step Size Information

These are plots of the integrator step size per chain (x-axis) against the log-posterior (y-axis top panel) and against the acceptance statistic (y-axis bottom panel) of the sampling algorithm. If the step size is too large, the integrator will be inaccurate and too many proposals will be rejected. If the step size is too small, the many small steps lead to long simulation times per interval. Thus the goal is to balance the acceptance rate between these extremes. Good plots will show full exploration of the log-posterior and moderate to high acceptance rates for all chains and step sizes. Bad plots might show incomplete exploration of the log-posterior and lower acceptance rates for larger step sizes.

Acceptance Information

These are plots of the acceptance statistic (top leftpanel), the log-posterior (top right panel), and, the acceptance statistic (x-axis bottom panel) against the log-posterior (y-axis bottom panel) for all chains. The vertical lines indicate the mean (solid line) and median (dashed line). A bad plot would show a relationship between the acceptance statistic and the log-posterior. This might be indicative of poor exploration of parts of the posterior which might be might be mitigated by reparametrization or adaptation of the step size. If many proposals are rejected the integrator step size might be too large and the posterior might not be fully explored. If the acceptance rate is very high this might be indicative of inefficient sampling. The target Metropolis acceptance rate can be set with the adapt_delta control option. For more information see https://mc-stan.org/docs/reference-manual/hmc-algorithm-parameters.html.

Scatter plots

These are scatter plots of the 3 worst performing parameters in terms of n_eff, plotted against log-posterior. The red dots, if present, indicate divergent transitions. Divergent transitions can indicate problems for the validity of the results. A good plot would show no divergent transitions. A bad plot would show divergent transitions in a systematic pattern. For more information see https://mc-stan.org/misc/warnings.html#divergent-transitions-after-warmup.

Autocorrelation

These are autocorrelation plots of the 3 worst performing parameters in terms of n_eff. The autocorrelation expresses the dependence between the samples of a Monte Carlo simulation. With higher dependence between the draws, more samples are needed to obtain the same effective sample size. High autocorrelation can sometimes be remedied by reparametrization of the model.

Trace Plots

These are trace plots of the 3 worst performing parameters in terms of n_eff, for all chains. Trace plots provide a visual way to inspect sampling behavior and assess mixing across chains. The iteration number (x-axis) is plotted against the parameter value at that iteration (y-axis). Divergent transitions are marked on the x-axis. A good plot shows chains that move swiftly through the parameter space and all chains that explore the same parameter space without any divergent transitions. A bad plot shows chains exploring different parts of the parameter space, this is a sign of non-convergence. If there are divergent transitions, looking at the parameter value related to these iterations might provide information about the part of the parameter space that is difficult to sample from. Slowly moving chains are indicative of high autocorrelation or small integrator step size, both of which relate to ineffective sampling and lower effective sample sizes for the parameter.

Rank Plots

These are rank plots of the 3 worst performing parameters in terms of n_eff, for all chains. Rank histograms visualize how the values from the chains mix together in terms of ranking. An ideal plot would show the rankings mixing or overlapping in a uniform distribution. See Vehtari et al. (2019) for details.

Model Code